Laser lithotripsy with stone recognition